package com.yanqu.road.logic.activity.qixi;

import com.yanqu.road.entity.activity.ActivityConfig;
import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.config.goods.GoodsInfo;
import com.yanqu.road.utils.property.Property;
import com.yanqu.road.utils.property.PropertyHelper;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class QixiConfig {
    private int activityId;
    private ActivityInfo activityInfo;

    private int QIXI_PINK_ROSE_ID = 123431;
    private int QIXI_RED_ROSE_ID = 123432;
    private int QIXI_ROMANTIC_ROSE_ID = 123433;

    /**
     * 广播随机奖励池
     */
    private List<List<Property>> broadcastReward = new ArrayList<>();
    /**
     * 广播领奖有效时间分钟
     */
    private int QIXI_BROADCASTING_TIME = 20;
    /**
     * 赠送记录页签人数
     */
    private int QIXI_GIVE_AWAY_RECORD = 20;
    /**
     * 广播宣言固定文本
     */
    private String QIXI_BROADCASTING_CONTENT = "广播宣言固定文本";
    /**
     * 礼物上限
     */
    private int QIXI_GIFT_LIMIT = 99;

    public QixiConfig(ActivityInfo activityInfo, Map<String, ActivityConfig> activityConfigMap) {
        this.activityId = activityInfo.getActivityId();
        this.activityInfo = activityInfo;

        this.QIXI_PINK_ROSE_ID = activityConfigMap.get("QIXI_PINK_ROSE_ID").getIntValue();
        this.QIXI_RED_ROSE_ID = activityConfigMap.get("QIXI_RED_ROSE_ID").getIntValue();
        this.QIXI_ROMANTIC_ROSE_ID = activityConfigMap.get("QIXI_ROMANTIC_ROSE_ID").getIntValue();
        this.QIXI_BROADCASTING_TIME = activityConfigMap.get("QIXI_BROADCASTING_TIME").getIntValue();
        this.QIXI_GIVE_AWAY_RECORD = activityConfigMap.get("QIXI_GIVE_AWAY_RECORD").getIntValue();
        this.QIXI_BROADCASTING_CONTENT = activityConfigMap.get("QIXI_BROADCASTING_CONTENT").getValue();

        this.broadcastReward = PropertyHelper.parseNewStringToPropertyList(activityConfigMap.get("QIXI_BROADCASTING_REWARD").getValue());

        this.QIXI_GIFT_LIMIT = activityConfigMap.get("QIXI_GIFT_LIMIT").getIntValue();

    }


    public void setQIXI_PINK_ROSE_ID(int QIXI_PINK_ROSE_ID) {
        this.QIXI_PINK_ROSE_ID = QIXI_PINK_ROSE_ID;
    }

    public void setQIXI_RED_ROSE_ID(int QIXI_RED_ROSE_ID) {
        this.QIXI_RED_ROSE_ID = QIXI_RED_ROSE_ID;
    }

    public void setQIXI_ROMANTIC_ROSE_ID(int QIXI_ROMANTIC_ROSE_ID) {
        this.QIXI_ROMANTIC_ROSE_ID = QIXI_ROMANTIC_ROSE_ID;
    }

    public void setBroadcastReward(List<List<Property>> broadcastReward) {
        this.broadcastReward = broadcastReward;
    }

    public void setQIXI_BROADCASTING_TIME(int QIXI_BROADCASTING_TIME) {
        this.QIXI_BROADCASTING_TIME = QIXI_BROADCASTING_TIME;
    }

    public void setQIXI_GIVE_AWAY_RECORD(int QIXI_GIVE_AWAY_RECORD) {
        this.QIXI_GIVE_AWAY_RECORD = QIXI_GIVE_AWAY_RECORD;
    }

    public void setQIXI_BROADCASTING_CONTENT(String QIXI_BROADCASTING_CONTENT) {
        this.QIXI_BROADCASTING_CONTENT = QIXI_BROADCASTING_CONTENT;
    }

    public void setQIXI_GIFT_LIMIT(int QIXI_GIFT_LIMIT) {
        this.QIXI_GIFT_LIMIT = QIXI_GIFT_LIMIT;
    }

    public int getActivityId() {
        return activityId;
    }

    public ActivityInfo getActivityInfo() {
        return activityInfo;
    }

    public int getQIXI_PINK_ROSE_ID() {
        return QIXI_PINK_ROSE_ID;
    }

    public int getQIXI_RED_ROSE_ID() {
        return QIXI_RED_ROSE_ID;
    }

    public int getQIXI_ROMANTIC_ROSE_ID() {
        return QIXI_ROMANTIC_ROSE_ID;
    }

    public int getQIXI_BROADCASTING_TIME() {
        return QIXI_BROADCASTING_TIME;
    }

    public int getQIXI_GIVE_AWAY_RECORD() {
        return QIXI_GIVE_AWAY_RECORD;
    }

    public String getQIXI_BROADCASTING_CONTENT() {
        return QIXI_BROADCASTING_CONTENT;
    }

    public int getQIXI_GIFT_LIMIT() {
        return QIXI_GIFT_LIMIT;
    }

    public Property getBroadcastReward() {
        return PropertyHelper.randomPropertyByListList(broadcastReward);
    }
}
